package com.androidvizlab.bachelor.utilities;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class VizlabBroadCastReceiver extends BroadcastReceiver{

	private String msg = "";
	private static String GCM_MESSAGE[] = {"dataAvailable","message"};
	
	@Override
	public void onReceive(Context context, Intent intent) {
		
		if(intent.hasExtra(GCM_MESSAGE[1]))
		{
			msg = intent.getStringExtra(GCM_MESSAGE[1]);
		}
		
		WakeLockManager.acquire(context,"wakeup");
		
		Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
		
		WakeLockManager.release();
	}
}
